﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="billByNo.aspx.cs" Inherits="MxWeiXinPF.Web.weixin.jiaoshuifei.billByNo" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

    <link href="css/weui.min.css?v=1" rel="stylesheet" />
    <link href="css/jquery-weui.min.css" rel="stylesheet" />
    <link href="css/demos.css" rel="stylesheet" />


    <title>缴费账单</title>
</head>
<body ontouchstart>

    <input type="hidden" id="consNo" value="<%=list!=null&&list.Count>0?list[0].consNo:"" %>"/>
    <input type="hidden" id="consName" value="<%=list!=null&&list.Count>0?list[0].consName:"" %>"/>

    <div class="weui-cells">
        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd">
                <label for="" class="weui-label">选择用户</label>
            </div>
            <div class="weui-cell__bd">
                <select class="weui-select" id="userno" onchange="chocieNumber()">
                    <%--<option>请选择用户</option>--%>
                    <%if (list != null && list.Count > 0)
                        {
                            foreach (var item in list)
                            {%>
                    <option value="<%=item.consName%>|<%=item.consNo%>"><%=item.consName%>(<%=item.consNo%>)</option>

                    <%}

                        } %>
                </select>
            </div>
        </div>

    </div>

    <div class='demos-content-padded'>
        <a class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips" onclick="next()">下一步</a>
    </div>

    <%--<div class='demos-content-padded'>
        <div class="icon-box">

            <div class="icon-box__ctn">
                <h3 class="icon-box__title"><i class="weui-icon-info-circle"></i>温馨提示</h3>
                <p class="icon-box__desc">
                    请输入您水费单据上的用户号和用户名进行绑定<br />
                    如有疑问，请咨询<%=tel %> 。
                </p>
            </div>
        </div>
    </div>--%>


</body>
<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="js/jquery-weui.js"></script>
<script>

    function chocieNumber() {

        var consNo = $("#userno").val();
        if (consNo != null && consNo != "") {
            var arr = consNo.split('|');
            $('#consNo').val(arr[1]);
            $('#consName').val(arr[0]);
        }


    }
    //下一步
    function next() {

        var consNo = $('#consNo').val();
        var consName = $('#consName').val();

        if (consNo == null || consNo == "") {
            $.toptip('请输入用户号');

            return;
        }
        if (consName == null || consName == "") {
            $.toptip('请输入用户名');

            return;
        }
        //验证通过
        $.ajax({
            type: "post",
            url: "jsf_bindOne.ashx",
            data: { usernumber: consNo, username: consName, actionType: "GetUserNameByconsno", wid: '<%=wid%>', openid: '<%=openid%>' },
            beforeSend: function () {
                $.showLoading();
            },
            success: function (data) {
                if (data.succuss == 1) {
                    window.location.href = "billdetail.aspx?consno=" + consNo + "&consname=" + consName + "&wid=" + '<%=wid%>';
                    }
                    else {
                        $.hideLoading();
                        $.toptip(data.msg);
                    }
                }
        });
        }

</script>
</html>
